package foo.bar.wiki.web.action.page;

import foo.bar.wiki.web.action.ExtendedPaginatedList;
import foo.bar.wiki.web.action.PaginatedBaseActionBean;
import foo.bar.wiki.web.extension.PageTypeConverter;
import foo.bar.wiki.domain.Page;
import foo.bar.wiki.services.WikiService;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.validation.Validate;
import net.sourceforge.stripes.integration.spring.SpringBean;

/**
 * @author tmjee
 * @version $Date$ $Id$
 */
public class ViewPageActionBean extends PaginatedBaseActionBean {

    public static final String VIEW = "/page/viewPage.jsp";

    private WikiService wikiService;

    @Validate(converter = PageTypeConverter.class)
    private Page currentPage;


    @DefaultHandler
    public Resolution view() {
        return new ForwardResolution(generateThemePath(VIEW));
    }




    @SpringBean("wikiService")
    public void setWikiService(WikiService wikiService) {
        this.wikiService = wikiService;    
    }

    public Page getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Page page) {
        this.currentPage = page;
    }

}
